﻿@{
    ViewBag.Title = "Form";
}
@section Menu
{
    @Html.Partial("~/Views/Menu/Entries.cshtml", new ViewDataDictionary())
}
<script type="text/javascript">
//    $(function () {
//        $("#divUpdateUser").dialog({ autoOpen: false, modal: true, resizable: false });
//    });

    function openUpdateUserDialog() {
        //$("#divUpdateUser").dialog('open');
        $('#divUpdateUser').modal('toggle');
        $('#modalUpdateUser').toggle();
    }
</script>
@Ajax.ActionLink("Create new", "ActionForm", null, new AjaxOptions { UpdateTargetId = "divUpdateUser", OnBegin = "openUpdateUserDialog" },
        new { @class = "btn btn-primary" })
<br />
<br />
<div id="divIndexUser">
    @Html.Action("Index")
</div>

<div class="modal hide" id="modalUpdateUser">
    <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" onclick="closeDialogUser();">
            ×</button>
            <h3>User</h3>
    </div>
    <div class="modal-body" id="divUpdateUser">
    </div>
    <div class="modal-footer">
        <a href="#" class="btn btn-primary" id="buttonSave" onclick="$('#submitUser').click();">Save</a> 
        <a href="#" class="btn" data-dismiss="modal" onclick="closeDialogUser();">Cancel</a>
    </div>
</div>